<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    //成绩判断
    function isLevel(a) {
        if (a >= 90) {
            return "优秀";
        } else if (a >= 80) {
            return "良好";
        } else if (a >= 70) {
            return "一般";
        } else if (a >= 60) {
            return "及格";
        } else {
            return "不及格";
        }
    }
    var x=Math.round(Math.random() * 100);
    var y=isLevel(x);
    document.write(y+"<br>");

    //判断闰年
    function isRun(year) {
        if (year % 4 == 0 && year % 100 != 0 || year % 400 == 0) {
            return true;
        } else {
            return false;
        }
    }
    var year = Math.round(1000 + Math.random() * 8999);
    if (isRun(year)){
        document.write( year + "年为闰年");
    }else{
        document.write( year + "年为平年");
    }
    

</script>

</html>